package com.kinyx.framework.reflect;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.junit.Assert;
import org.junit.Test;

public class KAnnotationUtils_Tester_getValue {

	@Retention(RetentionPolicy.RUNTIME)
	public @interface A { String value(); }

	@A(value = "value")
	static class Bean {
		@A(value = "value")
		private String str;
	}

	@Test
	public void test() throws NoSuchFieldException, SecurityException {
		Assert.assertEquals("value", KAnnotationUtils.getValue(Bean.class, A.class.getName(), "value"));
		Assert.assertEquals("value", KAnnotationUtils.getValue(Bean.class.getDeclaredField("str"), A.class.getName(), "value"));
	}

}
